1. Field of the Invention
This invention relates to histograms and in particular to gray scale histograms and an algorithm for attributing the gray scale histograms to enable the sort of look alike acceptable and unacceptable items. The disclosed techniques find preferred use in the sorting of almonds.
2. Statement of the Problem
This invention is directed to the utilization of histograms as acquired by a machine vision system. Such machine vision systems are well known in the prior art. Specifically, they commonly include a passing stream of product and a video camera. The video camera takes an image and each individual image is thereafter analyzed with a histogram being produced.
In the present case, a gray scale histogram is preferred. The reader will realize that histograms relating to size, shape or other features may be used. For example, a histogram related to area, length, width, perimeter or aspect ratio can be used. Such use can be alone or combined with gray scale histograms.
The technique here disclosed is utilized for speed. Processing speed in excess of 175 items a second is required. When it is realized that look alike acceptable and unacceptable items must be sorted at such a speed, the difficulty encountered in distinguishing one histogram of an acceptable item from a similar histogram of an unacceptable item can be appreciated.
Decision criteria currently being utilized work well if the histogram signature of the desirable item, such as a fruit or nut, falls inside or outside a set of preferred ranges that define the desirable product from the undesirable product. Such an example can be seen with respect to FIG. 4. Unfortunately, in many cases, the histogram signature of agriculture products and their associated defects cannot be defined by maximum or minimum reference values. Attempts at utilizing various statistical techniques such as quadratic or linear discriminate analysis have not proven robust enough due to the amount of variation present in acceptable and unacceptable items within a stream of agricultural products.
Ranges have proven particularly unsatisfactory. It has been common in the prior art to create for each portion of the histogram range values which if satisfied indicate acceptable product and which if not satisfied indicate unacceptable product. Typically, these range values are placed together in series. An acceptable product must therefore fall within a series of acceptable ranges.
Such a sorting scheme does not acceptably operate when a sort of look-alike items is required. For example, assuming that the series of ranges are chosen so that only acceptable items will ultimately clear all of the ranges, the rejected items will be found to include many acceptable items. The difficulties encountered in sorts of look alike items can be emphasized by referring to FIGS. 4, 5, and 6.
FIG. 4 is a gray scale histogram depicting the gray shade distributions of an acceptable item and an unacceptable item. The histogram contains 16 shades of gray, shade 1 being black and shade 16 being white. It can be seen that the acceptable item is much darker than the defective item. It can be further seen that the distributions of each of the paired histograms for the acceptable item and the unacceptable item do not overlap. The decision criteria to separate the good from the bad in this case is simple. For example, if pixels are present in gray level 9 or higher, rejection can occur; otherwise, the product will be accepted. In the acceptable and unacceptable items characterized by this histogram there is such a significant difference that defective items can be rejected without worrying about the mixing of acceptable product in the rejected items. Unfortunately this is an idealistic representation of the type of condition that would be hoped for. It is not the kind of condition that is found in separating acceptable product from unacceptable product especially in the agriculture industries.
Referring to FIG. 5, a more common condition of histogram occurrence is there shown. Paired histograms are shown with an area of overlap which represents an area of indecision. Accepting or rejecting purely on the range of the histogram will result in error, this error being one of commonality. For example, and utilizing the range, if all items having gray scales of 7 through 11 are rejected, much acceptable product will likewise be rejected. It is this difficulty which causes a series of arbitrary ranges to either reject much acceptable product, or alternately to accept product that should be otherwise rejected, rather than to achieve the objective of minimizing both types of errors. Heretofore in the prior art vision systems have asked the user to accept tradeoffs that are simply not practical or would seriously jeopardize the economic justification of any machine vision recognition product.
Referring to FIG. 6 and by utilizing a series of ranges, the inspection task can be said to be literally unachievable. The gray scale histogram of the desired item is on average the same as the gray scale histogram of the undesirable item. This is the problem area to which the present invention is directed.
No one single set of decision criteria would apply in this case because the decision criteria stated will reverse itself many times. That is to say each criteria will include on either side of its dividing line both acceptable and unacceptable items.
Traditionally, agriculture products have been inspected by people with obvious success. The human brain utilizes multiple inputs from the eye that include, but by no means are limited to, color, shades of color, combinations of color, shade, shape, size and many other factors. The human brain contains in memory the person's experience of what all of the unacceptable objects look like. Quick comparison is made from the image of the eye to the retained experience criteria in the human memory. If the information from the eye is not contained in experience memory, the human can decide rationally to accept or reject the item.
In the prior art, it can been common to utilize gray scale histograms. Compared to the conventional human sorter, a gray scale histogram is essentially color blind.
Sorting of almonds is the preferred embodiment for our invention. Specifically acceptable almonds must be classified away from almonds which are spoiled, almonds which remain wholly or partially within their shells (in shell), fragments of the outer hull which encloses the in shell almond (hull), mud balls from the orchard floor, rocks from the orchard floor, and almonds that have been damaged during the hulling and shelling process (chips). With the exception of the chips, the types of foreign materials encountered in the separation of almonds happen to be among the most difficult agriculture objects to separate by machine vision. Some understanding of the harvest of almonds and their initial processing can be helpful.
Typically, when almonds are ripe, the nuts mature within hulls. The almond trees are shaken and the respective hulls fall to the orchard ground. Thereafter, the hulls are swept into rows and thereafter collected from the orchard floor.
The collected hulls are thereafter subject to a hulling process and mechanical sorting to separate leaves, twigs, and large debris from the relatively small almonds and other small contaminants. There results a single size mass containing mainly almonds but having impurities, such as in shell almonds, chips, mud balls, and rocks, all intermixed therein. It is to this mixture that the classification of this invention is directed.